#include "cimage.h"

/**
 * CImage - constructor, creates label
 * @param imgId
 */
CImage::CImage(int imgId) {
  this->init();
  this->imgId = imgId;
}
//---------------------------------------------------------------------------

/**
 * getImgId - returns id of image
 * @return image id
 */
int CImage::getImgId() const {
  return imgId;
}
//---------------------------------------------------------------------------

/**
 * setImgId - sets id of image
 * @param imgId
 */
void CImage::setImgId(int imgId) {
  this->imgId = imgId;
}
//---------------------------------------------------------------------------

/**
 * drawSelf - draws label
 * @param rendererPtr
 */
void CImage::drawSelf(CGuiRenderer* rendererPtr) {

  // Label dimensions without border
  unsigned short w(width - (style.getBorder().getSize() << 1));
  unsigned short h(height - (style.getBorder().getSize() << 1));

  // Draw image on label
  rendererPtr->drawRect(x + 1, y + 1, x + w, y + h, 255, CColor(), imgId);
}
//---------------------------------------------------------------------------
